<html>
	<head>
		<title>
			IPM::
			<% if not @title.nil? -%>
				<%= @title %>
			<% else -%>
				<%= controller.controller_name.to_s %>::<%= controller.action_name.to_s %>
			<% end -%>
		</title>
		<%= stylesheet_link_tag 'ipm' %>
		<%= javascript_include_tag :defaults %>
		<%= javascript_include_tag 'ipm' %>
	</head>
	<body>
		<% if controller.action_name != 'print' -%>
			<% if logged_in? -%>
			<div id="head_bar"> 
				<%= @current_user.login %> |
				<%= link_to 'Logout', :controller => 'account', :action => 'logout' %>
			</div>
			<% end -%>	
			
			<% if not @header_title .nil? -%>
				<div id="header"><h1><%= @header_title %></h1></div>
			<% end -%>
			<% if logged_in? -%>
			<div id="actions">
				<% @id = 0 %>
				<% (@id = @project.id) if not @project.nil? %>
				<% (@id = @ticket.project.id) if not @ticket.nil? %>
				<% (@id = @ticket_reply.ticket.project.id) if !@ticket_reply.nil? and  @ticket.nil? %>
				[Project: <%= select 'ticket', 'owner_id',  @current_user.active_projects.collect {|p| [p.name, p.id]}, {:selected=> @id}, {:onChange => "location.href='/project/'+this.value+'/show/';"} %> ]
				<%= ( ' - [' + link_to('Accounts', :controller => 'account', :action => 'list_active') +']') if @current_user.has_role?('user_admin') %>
				<%= ( ' - [' + link_to('Projects', :controller => 'project', :action => 'list') +']') %>
				<% if not @submenu.nil? -%>
					<br />
					<%= render :partial => 'layouts/' + @submenu %>
				<% end -%>
			</div>
			<% end -%>
		<% end -%>
		<div id="content">
		<% if flash[:notice] -%>
			<div id="notice" style="color:green"><%= flash[:notice] %></div>
		<% end -%>
		<% if flash[:error] -%>
			<div id="error" style="color:red"><%= flash[:error] %></div>
		<% end -%>
		
		<%= yield %>
		</div>
	</body>
</html>